package sv.gob.mh.dgii.model;

// Generated Dec 12, 2007 1:25:05 PM by Hibernate Tools 3.2.0.CR1

import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * DvEmision generated by hbm2java
 */
@Entity
@Table(name = "DV_EMISION", schema = "DEVOLUCIONES")
public class DvEmision implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 5277294486272160375L;
	private Long nemision;
	private DvTipoEmision dvTipoEmision;
	private DvEstado dvEstado;
	private TbClaseContrib tbClaseContrib;
	private TbObligacion tbObligacion;
	private DvPerFiscal dvPerFiscal;
	private Date fhemision;
	private Date fhejecucion;
	private Double vrangoInicial;
	private Double vrangoFinal;
	private Date fhingreso;
	private String cusuario;
	private String mtipoMedio;
	private String pagoaut;
	private Integer bactivo;
	private Long ndeclaraciones;
	private Date finEmision;
	private Double vrangoMaximo;
	private String notaAbono;
	private Integer cversion;
	private Date finicio;
	private Date fmaxima;
	private Set<DvMedioDevol> dvMedioDevols = new HashSet<DvMedioDevol>(0);
	private Set<DvErroresPagos> dvErroresPagoses = new HashSet<DvErroresPagos>(0);
	private Set<DvErrorEmision> dvErrorEmisions = new HashSet<DvErrorEmision>(0);
	private Set<DvNitEmision> dvNitEmisions = new HashSet<DvNitEmision>(0);

	public DvEmision() {
	}

	public DvEmision(Long nemision, DvTipoEmision dvTipoEmision) {
		this.nemision = nemision;
		this.dvTipoEmision = dvTipoEmision;
	}

	public DvEmision(Long nemision, DvTipoEmision dvTipoEmision, DvEstado dvEstado, TbClaseContrib tbClaseContrib, TbObligacion tbObligacion, DvPerFiscal dvPerFiscal,
			Date fhemision, Date fhejecucion, Double vrangoInicial, Double vrangoFinal, Date fhingreso, String cusuario, String mtipoMedio, String pagoaut,
			Set<DvMedioDevol> dvMedioDevols, Set<DvErroresPagos> dvErroresPagoses, Set<DvErrorEmision> dvErrorEmisions) {
		this.nemision = nemision;
		this.dvTipoEmision = dvTipoEmision;
		this.dvEstado = dvEstado;
		this.tbClaseContrib = tbClaseContrib;
		this.tbObligacion = tbObligacion;
		this.dvPerFiscal = dvPerFiscal;
		this.fhemision = fhemision;
		this.fhejecucion = fhejecucion;
		this.vrangoInicial = vrangoInicial;
		this.vrangoFinal = vrangoFinal;
		this.fhingreso = fhingreso;
		this.cusuario = cusuario;
		this.mtipoMedio = mtipoMedio;
		this.pagoaut = pagoaut;
		this.dvMedioDevols = dvMedioDevols;
		this.dvErroresPagoses = dvErroresPagoses;
		this.dvErrorEmisions = dvErrorEmisions;
	}

	@Id
	@Column(name = "N_EMISION", unique = true, nullable = false, precision = 10, scale = 0)
	public Long getNemision() {
		return this.nemision;
	}

	public void setNemision(Long nemision) {
		this.nemision = nemision;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "C_TIPO_EMISION", nullable = false)
	public DvTipoEmision getDvTipoEmision() {
		return this.dvTipoEmision;
	}

	public void setDvTipoEmision(DvTipoEmision dvTipoEmision) {
		this.dvTipoEmision = dvTipoEmision;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "C_ESTADO")
	public DvEstado getDvEstado() {
		return this.dvEstado;
	}

	public void setDvEstado(DvEstado dvEstado) {
		this.dvEstado = dvEstado;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "C_CLASE")
	public TbClaseContrib getTbClaseContrib() {
		return this.tbClaseContrib;
	}

	public void setTbClaseContrib(TbClaseContrib tbClaseContrib) {
		this.tbClaseContrib = tbClaseContrib;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "C_OBLIGACION")
	public TbObligacion getTbObligacion() {
		return this.tbObligacion;
	}

	public void setTbObligacion(TbObligacion tbObligacion) {
		this.tbObligacion = tbObligacion;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "FA_FISCAL")
	public DvPerFiscal getDvPerFiscal() {
		return this.dvPerFiscal;
	}

	public void setDvPerFiscal(DvPerFiscal dvPerFiscal) {
		this.dvPerFiscal = dvPerFiscal;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(insertable = false, name = "FH_EMISION", length = 7)
	public Date getFhemision() {
		return this.fhemision;
	}

	public void setFhemision(Date fhemision) {
		this.fhemision = fhemision;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(insertable = false, name = "FH_EJECUCION", length = 7)
	public Date getFhejecucion() {
		return this.fhejecucion;
	}

	public void setFhejecucion(Date fhejecucion) {
		this.fhejecucion = fhejecucion;
	}

	@Column(name = "V_RANGO_INICIAL", precision = 12, scale = 2)
	public Double getVrangoInicial() {
		return this.vrangoInicial;
	}

	public void setVrangoInicial(Double vrangoInicial) {
		this.vrangoInicial = vrangoInicial;
	}

	@Column(name = "V_RANGO_FINAL", precision = 12, scale = 2)
	public Double getVrangoFinal() {
		return this.vrangoFinal;
	}

	public void setVrangoFinal(Double vrangoFinal) {
		this.vrangoFinal = vrangoFinal;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(insertable = false, name = "FH_INGRESO", length = 7)
	public Date getFhingreso() {
		return this.fhingreso;
	}

	public void setFhingreso(Date fhingreso) {
		this.fhingreso = fhingreso;
	}

	@Column(name = "C_USUARIO", length = 30)
	public String getCusuario() {
		return this.cusuario;
	}

	public void setCusuario(String cusuario) {
		this.cusuario = cusuario;
	}

	@Column(insertable = false, name = "M_TIPO_MEDIO", length = 1)
	public String getMtipoMedio() {
		return this.mtipoMedio;
	}

	public void setMtipoMedio(String mtipoMedio) {
		this.mtipoMedio = mtipoMedio;
	}

	@Column(insertable = false, name = "PAGO_AUT", length = 1)
	public String getPagoaut() {
		return this.pagoaut;
	}

	public void setPagoaut(String pagoaut) {
		this.pagoaut = pagoaut;
	}

	@Column(name = "B_ACTIVO", precision = 1, scale = 0)
	public Integer getBactivo() {
		return bactivo;
	}

	public void setBactivo(Integer bactivo) {
		this.bactivo = bactivo;
	}

	@Column(name = "N_DECLARACIONES", precision = 10, scale = 0)
	public Long getNdeclaraciones() {
		return ndeclaraciones;
	}

	public void setNdeclaraciones(Long ndeclaraciones) {
		this.ndeclaraciones = ndeclaraciones;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(insertable = false, name = "FIN_EMISION", length = 7, updatable = false)
	public Date getFinEmision() {
		return finEmision;
	}

	public void setFinEmision(Date finEmision) {
		this.finEmision = finEmision;
	}

	@Column(name = "V_RANGO_MAXIMO", precision = 12, scale = 2)
	public Double getVrangoMaximo() {
		return vrangoMaximo;
	}

	public void setVrangoMaximo(Double vrangoMaximo) {
		this.vrangoMaximo = vrangoMaximo;
	}

	@Column(name = "NOTA_ABONO", length = 10)
	public String getNotaAbono() {
		return notaAbono;
	}

	public void setNotaAbono(String notaAbono) {
		this.notaAbono = notaAbono;
	}

	@Column(name = "C_VERSION", precision = 2, scale = 0)
	public Integer getCversion() {
		return cversion;
	}

	public void setCversion(Integer cversion) {
		this.cversion = cversion;
	}

	/**
	 * @return the finicio
	 */
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "F_INICIO", length = 7)
	public Date getFinicio() {
		return finicio;
	}

	/**
	 * @param finicio the finicio to set
	 */
	public void setFinicio(Date finicio) {
		this.finicio = finicio;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "F_MAXIMA", length = 7)
	public Date getFmaxima() {
		return fmaxima;
	}

	public void setFmaxima(Date fmaxima) {
		this.fmaxima = fmaxima;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "dvEmision")
	public Set<DvMedioDevol> getDvMedioDevols() {
		return this.dvMedioDevols;
	}

	public void setDvMedioDevols(Set<DvMedioDevol> dvMedioDevols) {
		this.dvMedioDevols = dvMedioDevols;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "dvEmision")
	public Set<DvErroresPagos> getDvErroresPagoses() {
		return this.dvErroresPagoses;
	}

	public void setDvErroresPagoses(Set<DvErroresPagos> dvErroresPagoses) {
		this.dvErroresPagoses = dvErroresPagoses;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "dvEmision")
	public Set<DvErrorEmision> getDvErrorEmisions() {
		return this.dvErrorEmisions;
	}

	public void setDvErrorEmisions(Set<DvErrorEmision> dvErrorEmisions) {
		this.dvErrorEmisions = dvErrorEmisions;
	}

	/**
	 * @return the dvNitEmisions
	 */
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "dvEmision")
	public Set<DvNitEmision> getDvNitEmisions() {
		return dvNitEmisions;
	}

	/**
	 * @param dvNitEmisions
	 *            the dvNitEmisions to set
	 */
	public void setDvNitEmisions(Set<DvNitEmision> dvNitEmisions) {
		this.dvNitEmisions = dvNitEmisions;
	}

}
